x11: Use resize counting for freezing updates too
authorJonas Ådahl <jadahl@gmail.com>
Fri, 4 Dec 2020 23:07:21 +0000 (00:07 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Mon, 7 Dec 2020 19:37:29 +0000 (20:37 +0100)
It's already keep strack of when we're waiting for configure events, so
lets reuse it. This fixes an issue where reshown dialogs wouldn't
reappear.

gdk/x11/gdkdisplay-x11.c
gdk/x11/gdksurface-x11.c
gdk/x11/gdksurface-x11.h

index 692f85230c9fd621cd8a33a23de63dc18f46fa35..73529906c5d7bd7bacf24a2aef15ff97b5789404 100644 (file)
@@ -920,16 +920,6 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
              int ty = 0;
              Window child_window = 0;
 
-              if (surface_impl->pending_configure_events == 1)
-                {
-                  surface_impl->pending_configure_events = 0;
-                  gdk_surface_thaw_updates (surface);
-                }
-              else if (surface_impl->pending_configure_events > 1)
-                {
-                  surface_impl->pending_configure_events--;
-                }
-
               x = y = 0;
              gdk_x11_display_error_trap_push (display);
              if (XTranslateCoordinates (GDK_SURFACE_XDISPLAY (surface),
index 15c296ae45ebbc64f05413777cb16feb25e29576..a4b6e5f6ce122a39eabef172b445646f0e2adcce 100644 (file)
@@ -1626,8 +1626,13 @@ x11_surface_resize (GdkSurface *surface,
     }
   else
     {
-      if (width * impl->surface_scale != impl->unscaled_width || height * impl->surface_scale != impl->unscaled_height)
-        surface->resize_count += 1;
+      if (width * impl->surface_scale != impl->unscaled_width ||
+          height * impl->surface_scale != impl->unscaled_height)
+        {
+          surface->resize_count++;
+          if (surface->resize_count == 1)
+            gdk_surface_freeze_updates (surface);
+        }
     }
 }
 
@@ -1678,8 +1683,13 @@ x11_surface_move_resize (GdkSurface *surface,
     }
   else
     {
-      if (width * impl->surface_scale != impl->unscaled_width || height * impl->surface_scale != impl->unscaled_height)
-        surface->resize_count += 1;
+      if (width * impl->surface_scale != impl->unscaled_width ||
+          height * impl->surface_scale != impl->unscaled_height)
+        {
+          surface->resize_count++;
+          if (surface->resize_count == 1)
+            gdk_surface_freeze_updates (surface);
+        }
     }
 }
 
@@ -4244,6 +4254,9 @@ _gdk_x11_moveresize_configure_done (GdkDisplay *display,
   XEvent *tmp_event;
   MoveResizeData *mv_resize = get_move_resize_data (display, FALSE);
 
+  gdk_surface_thaw_updates (surface);
+  gdk_surface_request_layout (surface);
+
   if (!mv_resize || surface != mv_resize->moveresize_surface)
     return FALSE;
 
@@ -5068,10 +5081,6 @@ gdk_x11_toplevel_present (GdkToplevel       *toplevel,
                           size.shadow.bottom);
     }
 
-  impl->pending_configure_events++;
-  if (impl->pending_configure_events == 1)
-    gdk_surface_freeze_updates (surface);
-
   if (gdk_toplevel_layout_get_maximized (layout))
     gdk_x11_surface_maximize (surface);
   else
index 1e4782797171e8d02ad22b3c9e8c02c224ef3335..6fd7122ba03d9038d1188606c9dfe0421858143b 100644 (file)
@@ -72,8 +72,6 @@ struct _GdkX11Surface
   int unscaled_width;
   int unscaled_height;
 
-  int pending_configure_events;
-
   struct {
     int configured_width;
     int configured_height;